Device Manager

Monitors every device within the system
Ensures each process gets fair access to the devices it needs

The Device Manager:

Layers of Abstraction

Device Abstraction

Devices can be categorised by their behaviour

Device Buses

External devices are called peripherals
Devices can be internal too, eg. soldered onto the motherboard
Others can be plugged into sockets or slots on the motherboard (via a daughterboard)

There a multiple buses designed for different purposes:

Each bus has its own protocol and format (and speed) for sending and receiving data

System Bus Connections

![[Pasted image 20250519025328.png]]

Communication

The device controller has several registers to pass commands and data to the device

Device and Disk Scheduling

The device manager schedules I/O activities to maximise system performance

Disk Block Scheduling

The scheduler tried efficiently to read/write disk blocks to minimise process wait time

Buffering

For a program that for example reads characters from a file one by one

The system could use double buffering

Spooling

Some devices are non-shareable

Direct Memory Access

Hardware devices can access main memory independently of the CPU

DMA Controller

The DMA controller has its own registers (MAR, byte counter, control register)

Devices in Linux

Linux creates a virtual file within the /dev directory for each device in the system

Some pseudo devices are also created

Device Reading Writing
/dev/null Sends EOF character (end of file) Discards all data
/dev/zero Stream of NUL characters (zeroes) Discards all data
/dev/full Stream of NUL characters (zeroes) Generates 'disk full' error
/dev/random Stream of pseudo-random bytes (from environmental noise) Adds noise to entropy pool

Device files start with certain letters to show what type of device they are